package Loganseabolt;


import Loganseabolt.weapons.War_Sword;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDirt;
import net.minecraft.block.BlockTNT;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

public class util
{
    public static void recipe()
    //makes available from anywhere
    {
    	ItemStack Dia= new ItemStack(LoganSeaboltModBase.QuickBaseWand);
    	ItemStack Diamond= new ItemStack(Item.diamond);
    	ItemStack gold= new ItemStack(Item.ingotGold);
    	ItemStack iron= new ItemStack(Item.ingotIron);
    	ItemStack HMI9 = new ItemStack(LoganSeaboltModBase.HMI, 9);
    	ItemStack HMI= new ItemStack(LoganSeaboltModBase.HMI);
        ItemStack DSc= new ItemStack(LoganSeaboltModBase.Death_Scycthe);
        ItemStack WS= new ItemStack(LoganSeaboltModBase.War_sword);
    	ItemStack RedS= new ItemStack(Item.redstone, 10);
        ItemStack RedST= new ItemStack(Item.redstone, 1);
        ItemStack HorsemanB= new ItemStack(LoganSeaboltModBase.HorseB);
    	ItemStack EnrGrs= new ItemStack(LoganSeaboltModBase.Enriched_Grass);
        ItemStack DrtLthr= new ItemStack(LoganSeaboltModBase.Dirty_Leather);
    	ItemStack leather= new ItemStack(Item.leather, 2);
        ItemStack Leather= new ItemStack(Item.leather, 1);
        ItemStack Dirt = new ItemStack(Block.dirt);
        ItemStack Glass = new ItemStack(Block.glass);
        ItemStack GS= new ItemStack(LoganSeaboltModBase.Grass_Sword);
        ItemStack CobbleStone= new ItemStack(Block.cobblestone, 1);
        ItemStack Mossy= new ItemStack(Block.cobblestoneMossy, 10);
        ItemStack Vines= new ItemStack(Block.vine, 1);
        ItemStack Grass= new ItemStack(Block.grass, 1);
        ItemStack Piston= new ItemStack(Block.pistonBase, 1);
        ItemStack SPiston= new ItemStack(Block.pistonStickyBase);
        ItemStack XP= new ItemStack(Item.expBottle, 7);
        ItemStack L2= new ItemStack(LoganSeaboltModBase.Logan2);
        ItemStack Soul= new ItemStack(LoganSeaboltModBase.Souls);
        ItemStack Cr= new ItemStack(LoganSeaboltModBase.MEDIC);
        ItemStack FG= new ItemStack(LoganSeaboltModBase.Furys_Gun);
        ItemStack GP= new ItemStack(Item.gunpowder);
        ItemStack TNT= new ItemStack(Block.tnt);
        ItemStack HG= new ItemStack(LoganSeaboltModBase.Holy_HandG);
        ItemStack WH= new ItemStack(LoganSeaboltModBase.WarH);
        ItemStack WC= new ItemStack(LoganSeaboltModBase.WarC);
        ItemStack WL= new ItemStack(LoganSeaboltModBase.WarL);
        ItemStack WB= new ItemStack(LoganSeaboltModBase.WarB);
        ItemStack IS= new ItemStack(LoganSeaboltModBase.itsa, 8);
        
        
        GameRegistry.addShapelessRecipe(leather, Dirt);
        GameRegistry.addShapelessRecipe(leather, Leather);
        GameRegistry.addSmelting(Item.leather.itemID, XP, 100);;
        GameRegistry.addShapedRecipe(Mossy,"xy ","   ","   ",'x',Vines,'y',CobbleStone);
        GameRegistry.addSmelting(Block.stone.blockID, CobbleStone, 20);
        GameRegistry.addShapelessRecipe(L2, Mossy);
        GameRegistry.addShapelessRecipe(Vines, Grass);
        GameRegistry.addShapedRecipe(DrtLthr, "xy ","yx ","   ",'x',Dirt,'y',Leather);
        GameRegistry.addShapedRecipe(EnrGrs,"yxy","   ","   ",'x', Dirt,'y', DrtLthr);
        GameRegistry.addShapedRecipe(SPiston,"xyx"," x "," x ",'x', EnrGrs, 'y', DrtLthr);
        GameRegistry.addShapedRecipe(Piston,"xyx"," x "," x ",'x', DrtLthr, 'y', EnrGrs);
        GameRegistry.addShapedRecipe(GS, " x "," x "," y ", 'x', EnrGrs, 'y', DrtLthr);
        GameRegistry.addShapedRecipe(HMI," x ","yza","zzz",'x', Diamond,'y',iron,'z',Soul,'a',gold);
        GameRegistry.addShapedRecipe(HorsemanB,"xxx","xxx","xxx",'x',HMI);
        GameRegistry.addShapelessRecipe(HMI9, HorsemanB);
        GameRegistry.addShapedRecipe(IS, "xyx","xzx","xyx",'x', HMI, 'y', HorsemanB);
        GameRegistry.addShapedRecipe(WH, "xxx","xyx","  ",'x', HMI, 'y', HorsemanB);
        GameRegistry.addShapedRecipe(WC, "zyz","xxx","xyx",'x', HMI, 'y', HorsemanB,'z', DrtLthr);
        GameRegistry.addShapedRecipe(WL, "xyx","x x","y y",'x', HMI, 'y', HorsemanB);
        GameRegistry.addShapedRecipe(WB, "x x","y y","   ",'x', HMI, 'y', HorsemanB);
        GameRegistry.addShapedRecipe(WB, "   ","x x","y y",'x', HMI, 'y', HorsemanB);
        GameRegistry.addShapedRecipe(WS, "xyx","xyx"," z ",'x', HMI, 'y', HorsemanB,'z', DrtLthr);
        GameRegistry.addShapedRecipe(DSc, "xxz","x z","  y",'x', HMI, 'y', HorsemanB,'z', DrtLthr);
        GameRegistry.addShapedRecipe(DSc, "xxy"," yx","z x",'x', HMI, 'y', HorsemanB,'z', DrtLthr);
        GameRegistry.addShapedRecipe(Dia, "x  ","y  ","   ",'x', Dirt, 'y', Leather);
        GameRegistry.addShapedRecipe(Cr, " x ","xxx"," x ",'x', gold);
        GameRegistry.addShapedRecipe(FG, "xxx","x y","xx ",'x',HMI,'y',GP);
        GameRegistry.addShapedRecipe(HG, " x ", "yzy","yzy",'x',Cr,'y',gold,'z',TNT);
        
        
        //GameRegistry.addShapelessRecipe(Arrow, GS);
        //ItemStack Arrow= new ItemStack(iDTechModBase.Grass_Arrow);
        //ItemStack Bow= new ItemStack(iDTechModBase.Grass_Bow);
    }
    public static Vec3 placeInFrontOfEntity(Entity _entity, float meters )
    {
            Vec3 ret = Vec3.createVectorHelper(0,0,0);
            ret.xCoord = _entity.posX;
            ret.yCoord = _entity.posY;
            ret.zCoord = _entity.posZ;
            float yaw = _entity.rotationYaw - 90;
            ret.xCoord -= ((double)(MathHelper.cos(yaw/ 180.0F * (float)Math.PI))) * meters;
            ret.zCoord -= ((double)(MathHelper.sin(yaw/ 180.0F * (float)Math.PI))) * meters;
            return ret;
    }
    public static Vec3 placeInRandomDirection(int x, int y, int z, float metersAway )
    {
            Vec3 ret = Vec3.createVectorHelper(0,0,0);
            ret.xCoord = x;
            ret.yCoord = y;
            ret.zCoord = z;
            double yaw =  Math.random() * 360;
            ret.xCoord -= ((double)(MathHelper.cos((float)yaw/ 180.0F * (float)Math.PI))) * metersAway;
            ret.zCoord -= ((double)(MathHelper.sin((float)yaw/ 180.0F * (float)Math.PI))) * metersAway;
            return ret;
    }
}
